bench: evaluate on the held-out split, not the training data - #160
Conversation
Greptile SummaryThe PR moves the Neuralchemy benchmark from contaminated training data to the held-out
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| README.md | Replaces contaminated headline metrics and the misstated benign denominator with held-out results and explicit counts. |
| sdk/README.md | Fully replaces the previously reported 4,391-row training results with consistent core/test metrics and caveats. |
| sdk/benchmarks/download.py | Pins Neuralchemy to the core configuration, defaults to test, and exposes a validated split-selection option. |
| sdk/docs/BENCHMARKS.md | Documents the held-out evaluation, corrected metrics, historical discrepancy, and broader false-positive behavior. |
| sdk/docs/EVAL_PHASE_C.md | Retains the dated training-split results while clearly marking them superseded and linking to current metrics. |
Reviews (2): Last reviewed commit: "retract contaminated numbers from the pa..." | Re-trigger Greptile
|
|
||
|
|
||
| On the neuralchemy prompt-injection set, regex-only detection reaches **F1 0.58 / recall 0.41** — a fast first line, not sufficient alone. Adding the ML span model (`Guard(model="tiny")`) takes that to **F1 0.99 / recall 0.98**, and lifts recall on *indirect* injection from **0.05 → 0.91**. False-positive rate stays under 1% on the injection set (2.1% on a separate hard-benign corpus). Full tables, methodology, and honest caveats: [`sdk/docs/BENCHMARKS.md`](sdk/docs/BENCHMARKS.md). Per-axis model metrics (including failure modes) are on the [model card](https://huggingface.co/Unplug-AI/unplug-tiny-v1). | ||
| On the held-out `core/test` split of the neuralchemy prompt-injection set (942 rows), regex-only detection reaches **F1 0.52 / recall 0.35**, a fast first line and not sufficient alone. Adding the ML span model (`Guard(model="tiny")`) takes that to **F1 0.97 / recall 0.96**, and lifts recall on *indirect* injection from **0.05 to 0.91**. False positives on that split run at 5 of 390 benign rows, and 2.1% on a separate 135-prompt hard-benign corpus. On broader public benign sets the model over-flags badly, up to 34% of a combined 3,227-prompt validation set, so tune the threshold for your own traffic rather than trusting the defaults. Full tables, methodology, and the axes where it fails: [`sdk/docs/BENCHMARKS.md`](sdk/docs/BENCHMARKS.md). Per-axis model metrics are on the [model card](https://huggingface.co/Unplug-AI/unplug-tiny-v1). |
There was a problem hiding this comment.
Superseded metrics remain published
When users read the package-facing sdk/README.md, it still presents the 4,391-row training-split results as current, causing the contaminated 0.99 F1 and 0.98 recall figures that this PR retracts to remain publicly advertised.
Knowledge Base Used: Audit and security evaluation
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
benchmarks/download.pypulledneuralchemy/Prompt-injection-datasetwithsplit="train"and no config. That is the splitunplug-tinywas fine-tuned on, sothe headline detection numbers in
BENCHMARKS.mdand the README were scoring themodel against its own training data.
The row counts line up exactly. HF reports
coreas train 4391 / validation 941 /test 942, and the page reported 4,391 samples. The model card gates on
neuralchemy_test_doc_recall, which is the 942-row test split.Re-measured on
core/test, both modes,--isolated:Against the published 0.987 / 0.981, contamination was worth about 2.3 points of
recall. Regex-only moved as well, 0.405 down to 0.351, and regex has no training data,
so some of the gap is just that the splits are not equally hard. Both docs say so.
The FPR change matters more than the recall change. The README claimed the
false-positive rate "stays under 1%". It is 5 false positives in 390 benign holdout rows, and the model card's
own public-benchmark axes are far worse: 18.8% on Deepset (662), 54.2% on WildGuard benign (971),
34.1% on a combined 3,227-prompt validation set. Those numbers were only on Hugging
Face. They are in
BENCHMARKS.mdnow, under a section that says to tune the thresholdbefore putting this in front of users.
Changes:
download.pypins the config tocoreand defaults to thetestsplit, with a--neuralchemy-splitflag for anyone who deliberately wants train.BENCHMARKS.mdgets the holdout numbers, a note on what changed, and the publicbenchmark table.
EVAL_PHASE_C.mdkeeps its numbers as a record of that run and gets a supersedednote, since rewriting a dated report would be worse.
microsoft/llmail-injectis unchanged. I have not checked it for overlap withfine-tuning data, so
BENCHMARKS.mdnow says to read that row as an upper boundrather than claiming it is clean.
Verified:
ruff checkandruff formatclean on the changed file,mkdocs build --strictexit 0, 1250 tests pass. The twotests/unit/ml/test_model_store.pyfailures reproduce on
devand are a local cached-model artifact, not from thisbranch.